home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
General
/
MacMETH3.2.1 Folder
/
MacMETH3.2.1 Disk 1⁄2
/
Examples
/
Example.MOD
< prev
next >
Wrap
Text File
|
1994-03-21
|
730b
|
24 lines
MODULE Example; (* W. Heiz, 26-Feb-86 / A. Fischlin, 4-Sep-92 *)
(* this program will produce two runtime errors (why?) *)
FROM Terminal IMPORT WriteString, WriteLn;
VAR x: INTEGER;
a: ARRAY [0..10] OF BOOLEAN;
PROCEDURE P(i: INTEGER; p: BOOLEAN);
BEGIN
a[i] := p; (* this statement should be high-lighted; Select Quit, then «Abort» *)
END P;
BEGIN
WriteString('Welcome to the wonderful world of Modula-2'); WriteLn; WriteLn;
WriteString("--- Debugger demo, please click in button «Debug» or type 'D'"); WriteLn;
x := 14;
P(0, TRUE);
HALT; (* Leave debugger by selecting menu command Continue *)
WriteString("--- Please click in button «Debug» or type 'D'");
P(x, FALSE);
END Example.